﻿using Hearthbuddy.Windows;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace windows
{
    /// <summary>
    /// AgreementWindow.xaml 的交互逻辑
    /// </summary>
    public partial class AgreementWindow : Window
    {
        public bool a=false;
        public AgreementWindow()
        {
            InitializeComponent();
        }
        public void CloseWindow(object sender, EventArgs e)
        {
            System.Environment.Exit(0);
        }
        private void Agree_Click(object sender, RoutedEventArgs e)
        {
            if (File.Exists(@"./我不同意.txt")) {
                File.Move(@"./我不同意.txt", @"./我同意.txt");
                a = true;
                Close();
            }
            else
            {
                System.Windows.Forms.Timer TimerClose =
				    new System.Windows.Forms.Timer();
                TimerClose.Interval = 10000;
                TimerClose.Tick += CloseWindow;
                TimerClose.Start();
                System.Windows.MessageBox.Show("缺少协议文件，请重新解压（先关掉杀毒软件防火墙等）", "协议", MessageBoxButton.OK, MessageBoxImage.Hand);
                System.Environment.Exit(0);
            }
        }

        private void Disagree_Click(object sender, RoutedEventArgs e)
        {
            System.Environment.Exit(0);
        }

    }
}
